package org.wyl.helloworld;

import us.codecraft.webmagic.ResultItems;
import us.codecraft.webmagic.Task;
import us.codecraft.webmagic.pipeline.Pipeline;

import java.util.List;

/**
 * 定义如果处理爬取下来的内容，保存到数据库或者输出日志？
 * @author 吴宇亮 on 2022/7/25 11:33
 */
public class HelloworldPipeline implements Pipeline {

    @Override
    public void process(ResultItems resultItems, Task task) {
        List<String> hotKeys = resultItems.get("hotKeys");
        for (String hotkey : hotKeys) {
            System.out.println(hotkey);
        }
    }

}
